<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<%@include file="/comment/comment.jsp" %>

<body>  
<!--Begin Header Begin-->
<%@include file="/comment/header.jsp"%>
<!--End Header End--> 
<!--Begin Login Begin-->
<div class="log_bg">	
    <div class="top">
        <div class="logo"><a href="Index.html"><img src="images/logo.png" /></a></div>
    </div>
	<div class="login">
    	<div class="log_img"><img src="images/l_img.png" width="611" height="425" /></div>
		<div class="log_c">
        	<form id="myform">
            <table border="0" style="width:455px; font-size:14px; margin-top:30px;" cellspacing="0" cellpadding="0">
              <tr height="50" valign="top">
              	<td width="55">&nbsp;</td>
                <td>
                	<span class="fl" style="font-size:24px;">登录</span>
                    <span class="fr">还没有商城账号，<a href="Regist.html" style="color:#ff4e00;">立即注册</a></span>
                </td>
              </tr>
              <tr height="70">
                  <td style="width: 60px">电话号码</td>
                  <td style="width: 100px"><input  style="width: 150px" type="text" name="phone" id="phone" value="" class="l_user" /></td>
                  <td style="width: 5px"></td>
                  <td style="width: 100px"><input  style="width: 100px" type="button" value="获取验证码" class="log_btn" onclick="sendMSM()" /></td>
              </tr>
              <tr height="70">
                  <td style="width: 60px">验证码</td>
                  <td><input  style="width: 150px" type="text" name="code" id="code" value="" class="l_pwd" /></td>
                  <td style="width: 5px"></td>
                  <td><input style="width: 100px" type="button" value="登录" class="log_btn" onclick="loginMSM()" /></td>
              </tr>
            </table>
                <input type="hidden" name="action" value="smslogin"/>
            </form>
        </div>
    </div>
</div>
<!--End Login End--> 
<!--Begin Footer Begin-->
<%@include file="/comment/version.jsp"%>
<!--End Footer End -->    
<script type="text/javascript">
    //验证码登入
  function loginMSM() {
      //发送
      $.ajax({
         url:"UserServlet",
          data:$("#myform").serialize(),
         success:function (data) {
           if(data==1){
               alert("输入的验证码错误。。");
           }else{
               location.href="client/Index.jsp";
           }
         }
      });
  }

    //短信验证码
    function sendMSM() {
        var phone = $("#phone").val(); //文本值
        //发送
        $.ajax({
            url:"UserServlet?action=sms&phone="+phone,
            success:function (data) {
                console.log("短信发送："+data)
            }
        });
    }
</script>
</body>


<!--[if IE 6]>
<script src="//letskillie6.googlecode.com/svn/trunk/2/zh_CN.js"></script>
<![endif]-->
</html>
